# !/usr/bin/env python
# _*_ coding:utf-8 _*_

from django.conf.urls import url

from . import views

urlpatterns = [
    # 1. 注册页面
    url(r'^register/$', views.RegisterView.as_view(),name="register"),

    # 2.判断用户名是否重复 usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view(), name="usernamecount"),

    # 3.判断手机号是否重复　mobiles/(?P<mobile>1[3-9]\d{9})/count/
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view(),
        name="mobile"),
    # 4. 登录功能
    url(r'^login/$', views.LoginView.as_view(), name="login"),

    # 5.退出功能 logout/
    url(r'^logout/$', views.LogoutView.as_view(), name="logout"),
    # 6.个人中心
    url(r'^info/$', views.UserInfoView.as_view(), name="info"),
    # 7.修改邮箱的值　emails/
    url(r'^emails/$', views.EmailView.as_view(), name='email'),
    # ８.激活邮箱　emails/verification/
    url(r'^emails/verification/$', views.VerifyEmailView.as_view(), name='verifyemail'),

    # 9. 显示收货地址address/
    url(r'^address/$', views.AddressView.as_view(), name='address'),
    # 10. 新增地址 addresses/create/
    url(r'^addresses/create/$', views.CreateAddressView.as_view(), name="creat_address"),

    # 11. 修改和删除  addresses/(?P<address_id>\d+)/
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view(), name="update_address"),

    # 12. 设置默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view(), name="default_address"),

    # 13. 设置标题
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.TitleAddressView.as_view(), name="title_address"),
    # 14. 显示修改密码页面 password/
    url(r'^password/$', views.ChangePwdView.as_view(), name="password"),
    # 15. 浏览记录 browse_histories/
    url(r'^browse_histories/$', views.HistoryBrowseView.as_view(), name="browse"),
]

